int sensorPin_1 = 0; //analog pin 0
int sensorPin_2 = 3; //analog pin 1

void setup(){
  Serial.begin(9600);
}

void loop(){

  int val_1;
  int val_2;
  char saida[8];
  
  boolean flag = false;
  
  val_1 = analogRead(sensorPin_1);
  val_2 = analogRead(sensorPin_2); 
  
  if( val_1<10 || val_2<10 ){
    flag = false;
  } else if(val_1>700 || val_2>700){
    flag = false;
  } else {
    flag = true;
  }
 
  if(flag){
    sprintf(saida,"%04d%04d", val_1, val_2);
    Serial.flush();
    Serial.print(saida);
    //just to slow down the output - remove if trying to catch an object passing by
    delay(20000); // 20 segundos
  } else {
    delay(500);
  }
  

}
